Skip to content

Add zone metadata resource #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Add zone metadata resource #83

wants to merge 10 commits into from

Conversation

selfuryon
Copy link

Add additional resource for managing zone metadata based upon #60

ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"nameservers"},
Copy link
Author

@selfuryon selfuryon May 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current tests in master are broken, so I ignore nameservers option in these tests

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its got back life. You can pull reverted commit and remove this part

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I will do

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -292,7 +303,7 @@ func (client *Client) GetZone(name string) (ZoneInfo, error) {
}
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
if resp.StatusCode != 200 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would suggest to change it back here. Also at some other places(I will point). Let keep the same style. http.StatusOK looks more clear at least for me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I got it, It was unclear for me because both styles are exists in the code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I am about to refactor the project a bit in near feature. 🙂

}
defer resp.Body.Close()

if resp.StatusCode != 200 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http.StatusOK

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@PetrusHahol
Copy link

PetrusHahol commented Jun 4, 2021

I will do the review more thoroughly either during the weekend or on monday. So far it looks nice.


for _, mt := range mtdata {
if len(strings.Trim(mt.(string), " ")) == 0 {
log.Printf("[WARN] One or more values in 'metadata' contain empty '' value(s)")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume here was something in single quotes but you deleted it but quotes are left.
Plus you don't break this loop if you find empty metadata.
In case we will have N objects in list empty - it will through the message N times.
I would suggest add a break after this log.

Copy link

@PetrusHahol PetrusHahol Jun 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And also there is a function TrimSpace in strings package. We can use it instead of regular trim :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it, thanks!

@PetrusHahol
Copy link

The rest is fine. Can be merged when discussion above closed.

@pbnsh
Copy link

pbnsh commented Feb 8, 2022

Is there anything blocking this PR from being merged?

@mbag
Copy link
Collaborator

mbag commented Feb 8, 2022

@pbnsh I guess nothing. It just slipped my mind. Sorry. I will review it once again just so that , just to make sure everything is OK, and merge it ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants